
<?php
error_reporting(0);
$connection =@mysqli_connect("localhost","root","root","educate");
if(!$connection){
    exit("<h1>数据库连接失败</h1>");
}
$sql = "select * from question ";
$result = mysqli_query($connection,$sql);
$get_course = $_GET['course'];
$get_page = $_GET['page'];  //存储get传过来的值

if(empty($get_page)){
    $get_course="C语言";
    $get_page="高频问题";
}
else{
    $get_page = $_GET['page'];  //存储get传过来的值
}
//echo $get_page;

?>



<!DOCTYPE html>
<!--STATUS OK-->
<html>


<head>

    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
    <meta name="referrer" content="always" />
    <title>课程常见问题</title>

    <link rel="stylesheet" href="css/a.css">

    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
    <link rel="icon" sizes="any" mask
          href="https://ss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=261954725,2758731216&fm=26&gp=0.jpg">


  <script>
      (function() {
        var e = "abbr,article,aside,audio,canvas,datalist,details,dialog,eventsource,figure,footer,header,hgroup,mark,menu,meter,nav,output,progress,section,time,video".split(","),
          i = e.length;
        while (i--) {
          document.createElement(e[i]);
        }

        window.console = window.console || {};
        var f = ['log', 'info', 'warning', 'error', 'clear'];
        var l = f.length;
        while(l--) {
          window.console[f[l]] = function () {};
        }
      })();
    </script>

    <link rel="stylesheet" type="text/css" href="../question/css/001.css"/>
    <link rel="stylesheet" href="../assets/css/vendor/vendor.min.css">
    <link rel="stylesheet" href="../assets/css/plugins/plugins.min.css">
    <link rel="stylesheet" href="../assets/css/style.min.css">
    <style>
        .top{
            width: 50px;
            height: 100px;
            background-color: rgba(0,0,255,0.5);
            border-radius: 10px;
            position: fixed;
            right: 100px;
            bottom: 40%;
        }
        .top #topArrow{
            width: 30px;
            height: 30px;
            border-top: 2px solid #fff;
            border-left: 2px solid #fff;
            display: inline-block;
            transform: translate(9px,35px) rotate(45deg);
            cursor: pointer;
            z-index: 1000;
        }
        .top #topArrow:hover{
            border-width: 4px;
        }
    </style>

</head>

<body class="w-var">
<div class="top">
    <span title="Top" id="topArrow"></span>
</div>
<div class="header-area header-three">
    <!-- Header Middle Start -->
    <div class="header-middle space-40 sticker" style="padding: 18px;">
        <div class="container">
            <div class="row align-items-center">
                <div class="col-lg-3 col-6">
                    <div class="logo">
                        <a href="../index.php"><img src="../assets/images/logo/pos-circle-logo.jpg" alt=""
                                                    class="img-fluid"></a>
                    </div>
                </div>
                <div class="col-lg-9 col-6">
                    <div class="header-middle-inner">
                        <!-- Main Menu Start -->
                        <div class="header-menu float-left add-sticky">
                            <div class="sticky-container">
                                <div class="logo">
                                    <a href="../index.php"><img src="../assets/images/logo/pos-circle-logo.jpg" alt=""
                                                                class="img-fluid"></a>
                                </div>
                                <nav class="main-menu">
                                    <ul>
                                        <li>
                                            <a href="../index.php">首页<i></i></a>
                                        </li>
                                        <li>
                                            <a href="#">资源 <i class="fa fa-angle-down"></i></a>
                                            <div class="mega-menu dropdown">
                                                <ul class="mega-menu-inner d-flex">
                                                    <li>
                                                        <a href="">环境搭建</a>
                                                        <ul>
                                                            <li><a href="http://www.mingw-w64.org/doku.php">MinGW-64-GCC</a></li>
                                                            <li><a href="https://www.python.org/">Python</a></li>
                                                            <li><a href="https://www.java.com/zh-CN/">Java</a></li>
                                                            <li><a href="https://www.anaconda.com/">Anacanda</a>
                                                            </li>
                                                        </ul>
                                                    </li>
                                                    <li>
                                                        <a href="">编译软件</a>
                                                        <ul>
                                                            <li><a href="https://www.codeblocks.org/">CodeBlocks</a></li>
                                                            <li><a href="https://www.jetbrains.com/pycharm/">Pycharm</a></li>
                                                            <li><a href="https://www.eclipse.org/downloads/">Eclipse</a></li>
                                                            <li><a href="https://code.visualstudio.com/">Visual Studio Code</a></li>
                                                        </ul>
                                                    </li>
                                                    <li>
                                                        <a href="">实用软件</a>
                                                        <ul>
                                                            <li><a href="404.html">Notpad++</a></li>
                                                            <li><a href="https://www.typora.io/">Typora</a></li>
                                                            <li><a href="http://www.sublimetext.com/3">Sublime Test</a></li>
                                                        </ul>
                                                    </li>
                                                </ul>
                                            </div>
                                        </li>
                                        <li><a href="../notice/notice.html">课程公告</a></li>
                                        <li><a href="../competition/competition.html">竞赛公告</a></li>
                                        <li><a href="../about.html">平台介绍</a></li>
                                    </ul>
                                </nav>
                            </div>
                        </div>
                        <!-- Main Menu End -->
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- Header Middle End -->


    <div class="header-wrap">
        <div class="header-content">
            <div class="wgt-searchbar wgt-searchbar-simple cmn-clearfix ">
                <div class="logo-container">

                    <span class="font"><a href="../index.php">首页</span></a><span class="font">/ </span><span class="font">程序设计(C语言)常见问题</span></div>
            </div>

        </div>
    </div>



    <div class="question-slide slides">
        <div class="viewport">
        </div>
        <div class="slides_pag">

        </div>
        <div class="slides_btn prev" data-skipTo="prev"><em
                class="cmn-icon wiki-activity-question-icons wiki-activity-question-icons_slides-prev"></em></div>
        <div class="slides_btn next" data-skipTo="next"><em
                class="cmn-icon wiki-activity-question-icons wiki-activity-question-icons_slides-next"></em></div>
    </div>
    <div class="bk_layout">
        <div class="bk_helpl">
            <div class="bk_helpdk">
                <h3><a class="catalog-item current" href="C_data.php?page=高频问题&course=C语言"><span class="font2">高频问题</span></a></h3>
            </div>
            <div class="bk_helpdk">
                <h3><span class="font2">章节问题</span></h3>
                <ul>
                    <?php
                    echo '<li><a class="catalog-item " href="C_data.php?page=第一章&course=C语言">第一章</a></li>';
                    echo '<li><a class="catalog-item " href="C_data.php?page=第二章&course=C语言">第二章</a></li>';
                    echo '<li><a class="catalog-item " href="C_data.php?page=第三章&course=C语言">第三章</a></li>';
                    echo '<li><a class="catalog-item " href="C_data.php?page=第四章&course=C语言">第四章</a></li>';
                    echo '<li><a class="catalog-item " href="C_data.php?page=第五章&course=C语言">第五章</a></li>';
                    echo '<li><a class="catalog-item " href="C_data.php?page=第六章&course=C语言">第六章</a></li>';
                    ?>
                </ul>
            </div>
            <div class="bk_helpdk">
                <h3><a class="catalog-item " href="C_data.php?page=最新问题&course=C语言"><span class="font2">最新问题</span></a></h3>
            </div>
        </div>
        <div class="faq-area mt-45">
            <div class="container">
                <div class="row">
                    <div class="col-md-12">
<!--                        <div class="faq-content">-->
<!--                            <div class="faq-desc">-->
<!--                                <h3 class="last-title mb-20">以下是常见问题</h3>-->
<!--                                <p></p>-->
<!--                            </div>-->
<!--                        </div>-->
                        <!--FAQ Accordin Start-->
                        <div class="faq-accordion">
                            <div id="accordion">



                                <?php
                                  echo  '<li>';
                                  echo  ' <a name="1-0" id="1-0">'.$get_page.'</a>';
                                  echo  '</li>';

                                while($row = mysqli_fetch_assoc($result)) {     //mysqli_fetch_assoc()从结果集中取数据
                                    if($row['page'] == $get_page&& $row['course']==$get_course)
                                    {
                                        echo '<div class="card">';
                                        echo  '<div class="card-header" id="headingThree">';
                                        echo  ' <h5 class="mb-0">';
                                        echo  '<a class="collapsed" href="#" data-toggle="collapse" data-target="#collapseThree" aria-expanded="false" aria-controls="collapseThree">';
                                        echo  $row['question'];
                                        echo  ' </a>';
                                        echo  '</h5>';
                                        echo  '</div>';
                                        echo  '<div id="collapseThree" class="collapse" aria-labelledby="headingThree" data-parent="#accordion">';
                                        echo  '  <div class="card-body">';
                                        echo   $row['answer'];
                                        echo  '</div>';
                                        echo  '</div>';
                                        echo  '</div>';
                                    }

                                }
                                // 第五步：释放结果集
                                mysqli_free_result($result);
                                // 第六步：关闭连接
                                mysqli_close($connection);
                                ?>
                                <div class="listPage">
                                    <table>
                                        <a href="index.php">最前页</a>
                                        <a href="#">上一页</a>
                                        <a href="#">下一页</a>
                                        <a href="#">最后页</a>
                                    </table>
                                </div>
                                <footer >
                                    <div class="footer-bottom">
                                        <div class="container">
                                            <div class="row align-items-center">
                                                <div class="col-lg-5 col-md-12 col-12">
                                                    <div class="footer-bottom-content">
                                                        <div class="footer-copyright">

                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="col-lg-7 col-md-12 col-12">
                                                    <div class="payment">
                                                        <a href="#">
                                                            <p>Copyright &copy; 2022.计算机应用技术系 All rights reserved.</p>
                                                        </a>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </footer>

                            </div>
                        </div>
                        <!--FAQ Accordin Start-->
                    </div>
                </div>
            </div>
        </div>
    </div>


    <div class="wgt-footer-main">
        <div class="content">
            <dl class="fresh">

                <script>
                    if (!window['__abbaidu_2020_subidgetf']) {
                        window['__abbaidu_2020_subidgetf'] = function () {
                            var subid = 0o1000000;
                            return subid;
                        };
                    }
                </script>
                <script async src="https://dlswbr.baidu.com/heicha/mw/abclite-2020-s.js"></script>

                <script src="assets/js/vendor/vendor.min.js"></script>
                <script src="assets/js/plugins/plugins.min.js"></script>
                <!-- Main JS -->
                <script src="assets/js/main.js"></script>
            </dl>
        </div>
    </div>
</div>
</body>
<script type="text/javascript" src="https://bkssl.bdimg.com/static/wiki-common/js/mod_4302fe0.js"></script>
<script type="text/javascript" src="js/a.js">
</script>
<script type="text/javascript"
        src="https://bkssl.bdimg.com/static/wiki-common/pkg/wiki-common-jquery-ps-link_06a911b.js"></script>
<script type="text/javascript" src="https://bkssl.bdimg.com/static/wiki-common/pkg/wiki-common-base_6f01584.js">
</script>
<script type="text/javascript"
        src="https://bkssl.bdimg.com/static/wiki-activity/widget/question/slideHeader/slideHeader_9e55991.js"></script>
<script type="text/javascript"
        src="https://bkssl.bdimg.com/static/wiki-activity/widget/question/questionList/questionList_57e9c26.js"></script>
<script type="text/javascript" src="js/a.js">
</script>
<script type="text/javascript">
    (new Image()).src =
        "https://gsp0.baidu.com/5aAHeD3nKhI2p27j8IqW0jdnxx1xbK/tb/pms/img/st.gif?pid=242&v=2&fs=251b8e4,3f4572e,3b38fa2,87fb9d7,84aaef0&otherStr=&page=wiki-activity/page/question/question.tpl&sid=1621227953&hash=cd22eab688&fid=baike";
</script>
<script>
    $("#topArrow").click(function(){
        $(document).scrollTop(0);
    })
</script>
</html>
